package com.kmust.dream.wanderingdream.donation.controller;

import java.util.Arrays;
import java.util.Map;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.kmust.dream.wanderingdream.donation.entity.AuditFeedbackEntity;
import com.kmust.dream.wanderingdream.donation.service.AuditFeedbackService;
import com.kmust.dream.wanderingdream.comm.utils.PageUtils;
import com.kmust.dream.wanderingdream.comm.utils.R;



/**
 *
 *
 * @author Leng
 * @email Leng81605@gmail.com
 * @date 2021-07-11 14:11:08
 */
@RestController
@Api(tags = "审核反馈")
@RequestMapping("donation/auditfeedback")
@Deprecated
public class AuditFeedbackController {
    @Autowired
    private AuditFeedbackService auditFeedbackService;

    /**
     * 列表
     */
    @RequestMapping("/list")

    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = auditFeedbackService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{feedbackId}")

    public R info(@PathVariable("feedbackId") Integer feedbackId){
		AuditFeedbackEntity auditFeedback = auditFeedbackService.getById(feedbackId);

        return R.ok().put("auditFeedback", auditFeedback);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")

    public R save(@RequestBody AuditFeedbackEntity auditFeedback){
		auditFeedbackService.save(auditFeedback);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")

    public R update(@RequestBody AuditFeedbackEntity auditFeedback){
		auditFeedbackService.updateById(auditFeedback);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] feedbackIds){
		auditFeedbackService.removeByIds(Arrays.asList(feedbackIds));

        return R.ok();
    }

}
